]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
timeLimitsManager: Rename function updating state machine
authorIgnacy Kuchciński <ignacykuchcinski@gnome.org>
Mon, 27 Oct 2025 23:53:41 +0000 (00:53 +0100)
committerIgnacy Kuchciński <ignacykuchcinski@gnome.org>
Wed, 5 Nov 2025 14:22:12 +0000 (15:22 +0100)
Rename _updateSettings function to _updateStateMachine, since that's
what the function actually does, starting or stopping the machine
depending on the 'history-enabled' GSetting. Moreover, in the future
we'll take into account parental controls settings too, so renaming the
function to be more generic will avoid confusion later on.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3841>

js/misc/timeLimitsManager.js

index d4918de5d5ae9337b0c78d52192146d0cb6a95cc..1fa2c46ac2c4b509f8dd894377e8d7cebe9cf0d7 100644 (file)
@@ -159,7 +159,7 @@ export const TimeLimitsManager = GObject.registerClass({
         };
         this._screenTimeLimitSettings = this._settingsFactory.new('org.gnome.desktop.screen-time-limits');
         this._screenTimeLimitSettings.connectObject(
-            'changed', () => this._updateSettings(),
+            'changed', () => this._updateStateMachine(),
             'changed::daily-limit-seconds', () => this.notify('daily-limit-time'),
             'changed::daily-limit-enabled', () => this.notify('daily-limit-enabled'),
             'changed::grayscale', () => this.notify('grayscale-enabled'),
@@ -178,10 +178,10 @@ export const TimeLimitsManager = GObject.registerClass({
         this._ignoreClockOffsetChanges = false;
 
         // Start tracking timings
-        this._updateSettings();
+        this._updateStateMachine();
     }
 
-    _updateSettings() {
+    _updateStateMachine() {
         if (!this._screenTimeLimitSettings.get_boolean('history-enabled')) {
             if (this._state !== TimeLimitsState.DISABLED) {
                 this._stopStateMachine().catch(
@@ -190,7 +190,7 @@ export const TimeLimitsManager = GObject.registerClass({
             return false;
         }
 
-        // If this is the first time _updateSettings() has been called, start
+        // If this is the first time _updateStateMachine() has been called, start
         // the state machine.
         if (this._state === TimeLimitsState.DISABLED) {
             this._startStateMachine().catch(